<?php
/**
* @software         [JiJinCMS]
* @author           [上海集锦信息科技有限公司]
* @website          [http://www.jijinweb.com]
* @email            [sunny@jijinweb.com]
**/
namespace app\admin\controller;
use think\facade\View;
use think\facade\Db;
use think\facade\Request;
class Search extends \app\admin\controller\Admin{
    public function __construct(\think\App $app) {
        parent::__construct($app);

    }   
    public function index(){
        if(request()->isPost()){
            $settingstr="<?php \n return ".var_export($_POST,true).";";//配置文件str
            if(get_magic_quotes_gpc()){   //如果get_magic_quotes_gpc()是打开的
                $settingstr=stripslashes($settingstr);//将字符串进行处理    
            }                   
            $setting_path=config_path()."extra/search.php";//配置文件路径
            file_put_contents($setting_path,$settingstr);//保存到配置文件里
            //
            $this->UserLogModel->add("update","搜索设置","-");     
            $this->success("保存成功");            
        }        
        $table=Db::name("table")->select();
        View::assign("table",$table);
        return View::fetch();
    }
}

